﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace EX_NFC.FrontEnd.Windows.Converters
{
    /// <summary>
    /// Bool to its opposite converter
    /// </summary>
    /// <remarks></remarks>
    public class OppositeBoolConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool)
            {
                var thebool = (bool) value;
                return !thebool;
            }

            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool)
            {
                var thebool = (bool)value;
                return !thebool;
            }

            return false;
        }
    }
}
